<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport"
		content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta name="screen-orientation" content="portrait">
	<link rel="stylesheet" type="text/css" href="css/element-ui.css?v=1.0" />
	<link rel="stylesheet" type="text/css" href="css/example.css?v=1.0" />
	<link rel="stylesheet" type="text/css" href="css/weui.min.css?v=1.0" />
	<link rel="stylesheet" type="text/css" href="css/public.css?v=2.0" />
	<link rel="stylesheet" type="text/css" href="css/addPlace.css?v=4.0" />
	<title>编辑场所</title>
</head>

<body>
	<div id="main">
		<!-- 头部信息 -->
		<div v-cloak class="ub-banner">
			<img src="images/addPlaceBanner.png">
			<div class="ub-registration">场所信息登记</div>
		</div>
		<!-- 个人信息 -->
		<div v-cloak class="ub-current">
			<div>
				<img src="images/nike.png">
			</div>
			<div v-cloak>{{userInfo.nickname}}</div>
		</div>
		<div v-cloak class="ub-form" v-if="JSON.stringify(ruleForm) != '{}'">
			<el-form :model="ruleForm" :rules="rules" ref="ruleForm" class="demo-ruleForm">
				<el-form-item label="场所名称" prop="place_name">
					<el-input v-model="ruleForm.place_name" placeholder="请输入场所名称"></el-input>
				</el-form-item>
				<el-form-item label="场所分类" prop="category_id">
					<el-select v-model="ruleForm.category_id" placeholder="请选择场所分类"
						@change="getValue(ruleForm.category_id)">
						<el-option v-for="item in placeList" :key="item.cate_id" :label="item.cate_name"
							:value="item.cate_id">
						</el-option>
					</el-select>
				</el-form-item>
				<!-- <el-form-item label="网格" prop="grids_id">
					<el-cascader style="width: 100%;" v-model="ruleForm.grids_id" :options="communityInformation"
						:show-all-levels="false" @change="handleChange"></el-cascader>
				</el-form-item> -->
				<el-form-item label="场所主标签" prop="first_tags">
					<el-select v-model="ruleForm.first_tags" placeholder="请选择场所主标签">
						<el-option v-for="item in tagList" :key="item.tag" :label="item.tag_name" :value="item.tag">
						</el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="场所副标签" prop="tags" class="ub-tags">
					<el-checkbox-group v-model="ruleForm.tags">
						<el-checkbox v-for="item in tagList" :label="item.tag" :key="item.tag">
							{{item.tag_name}}</el-checkbox>
					</el-checkbox-group>
				</el-form-item>
				<el-form-item label="是否为九小场所" prop="is_small_place">
					<el-radio-group v-model="ruleForm.is_small_place">
						<el-radio :label="1">是</el-radio>
						<el-radio :label="0">否</el-radio>
					</el-radio-group>
				</el-form-item>
				<el-form-item label="是否涉餐饮" prop="is_cater">
					<el-radio-group v-model="ruleForm.is_cater">
						<el-radio :label="1">是</el-radio>
						<el-radio :label="0">否</el-radio>
					</el-radio-group>
				</el-form-item>
				<div style="position: relative;margin-top: 40px;">
					<div class="ub-charge" @click="addPrincipal()" style="z-index: 9;">增加联系人</div>
					<div v-for="(item, index) in ruleForm.link_man_info" class="ub-principal" :key="index">
						<el-form-item label="场所联系人、联系人电话" :prop="'link_man_info.' + index + '.name'"
							:rules="rules.contacts">
							<div @click="deleteBtn(index)" class="ub-shanc">删除</div>
							<el-input v-model="item.name" placeholder="请输入联系人姓名"></el-input>
						</el-form-item>
						<el-form-item label="" :prop="'link_man_info.' + index + '.phone'" :rules="rules.contacts">
							<el-input v-model="item.phone" placeholder="请输入联系人电话"></el-input>
						</el-form-item>
					</div>
				</div>
				<el-form-item label="场所详细地址" prop="address">
					<el-input v-model="ruleForm.address" placeholder="请输入场所详细地址"></el-input>
				</el-form-item>
				<el-form-item label="获取当前位置">
					<div class="ub-location">
						<img @click="getLocation()" src="images/placeLocation.png">
						<el-input disabled v-model="location" placeholder="点击获取当前定位"></el-input>
					</div>
				</el-form-item>
				<el-form-item label="基本情况说明" prop="content">
					<el-input type="textarea" :rows="5" v-model="ruleForm.content" placeholder="请输入基本情况说明">
					</el-input>
				</el-form-item>
				<!-- 附加字段 -->
				<div v-for="(item, index) in additionalList" :key="index">
					<el-form-item v-if="item.field_type == 'text'" :label="item.field_label"
						:rules="{required:true,message:item.hint, trigger: 'blur'}" :prop="item.field_name">
						<el-input v-model="ruleForm[item.field_name]" :placeholder="item.hint">
						</el-input>
					</el-form-item>
					<el-form-item v-if="item.field_type == 'radio'" :label="item.field_label"
						:rules="{required:true,message:item.hint, trigger: 'blur'}" :prop="item.field_name">
						<el-radio-group v-model="ruleForm[item.field_name]">
							<el-radio label="1">是</el-radio>
							<el-radio label="0">否</el-radio>
						</el-radio-group>
					</el-form-item>
					<el-form-item v-if="item.field_type == 'date'" :label="item.field_label"
						:rules="{required:true,message:item.hint, trigger: 'blur'}" :prop="item.field_name">
						<el-date-picker v-model="ruleForm[item.field_name]" type="date" :placeholder="item.hint"
							format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
						</el-date-picker>
					</el-form-item>
				</div>
			</el-form>
		</div>
		<!-- 上传照片 -->
		<div v-cloak class="ub-uploadImg">
			<div class="ub-uploadImg-title">
				<p>上传照片</p>
				<p>{{tempImages.length}}/9</p>
			</div>
			<div class="ub-upImage">
				<div style="position: relative;margin-right: 5px;" v-for="(item, index) in ruleForm.images">
					<img v-cloak @click="deleteImage(index)"
						style="width: 20px;position: absolute;right: -8px;top: -8px;" src="images/deteleImg.png">
					<img @click="lookImg(ruleForm.images)" style="width: 90px;height: 90px;object-fit: cover;"
						:src="item">
				</div>
				<i v-show="isUploadLoading" style="font-size: 20px;" class="el-icon-loading"></i>
				<div v-show="isUploadImg" class="ub-uploadImg-btn">
					<img @click="uploadImageBtn(1)" src="images/addPlaceupImg.png">
					<!-- <p>拍摄或上传照片</p> -->
				</div>
			</div>
		</div>
		<!-- 新增备注展示 -->
		<div v-cloak class="ub-note">
			<div class="ub-note-title">
				<p>备注</p>
				<div @click="addNoteBtn()">增加备注</div>
			</div>
			<div v-for="(item1,index1) in ruleForm.remark_record" style="margin-top: 5px;">
				<div style="display: flex;align-items: center;justify-content: space-between;font-size: 12px;">
					<div>备注{{index1 + 1}}</div>
					<div @click="deleteImgBtn(item1.id, index1)" style="display: flex;align-items: center;">
						<img style="width: 16px;margin-right: 10px;" src="images/shanchu.png">
						<span>删除</span>
					</div>
				</div>
				<div class="ub-remark">
					<span v-if="item1.str">
						{{item1.str}}
						<span v-if="item1.images.length > 0" style="color: #1275FF;" v-if="item1.images.length > 0"
							@click="lookImg(item1.images)">查看照片</span>
					</span>
					<span v-else>
						{{item1.remark}}
						<span v-if="item1.images.length > 0" style="color: #1275FF;" v-if="item1.images.length > 0"
							@click="lookImg(item1.images)">查看照片</span>
					</span>
				</div>
				<!-- <el-input disabled  type="textarea" :rows="5" v-model="item1.str?'item1.str':'item1.remark'" placeholder="请输入您的备注内容"></el-input> -->
				<!-- <div style="display: flex;align-items: center;margin: 10px;width: 100%;margin-right: 10px;overflow: auto;">
						<div v-for="item2 in item1.images" @click="lookImg(item1.images)">
							<img v-if="item2 != ''" style="width: 100px;margin-right: 10px;" :src="item2" >
						</div>
					</div> -->
			</div>
			<!-- <div v-for="item3 in noteList">
					<el-input disabled  type="textarea" :rows="5" v-model="item3.remark" placeholder="请输入您的备注内容"></el-input>
				</div> -->
		</div>

		<div v-cloak class="ub-button">
			<el-button @click="placeEditor('ruleForm')" :loading="loading" type="primary">完 成</el-button>
		</div>
		<!-- 提示信息弹窗 -->
		<el-dialog v-cloak center title="提示" :visible.sync="prompt" width="95%">
			<div style="text-align: center;">
				{{msg}}
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="goPlaceMan()">完 成</el-button>
			</span>
		</el-dialog>
		<!-- 新增备注弹窗 -->
		<el-dialog v-cloak center title="增加备注" :visible.sync="addNote" width="95%">
			<el-input type="textarea" :rows="5" v-model="newRrmark" placeholder="请输入您的备注内容"></el-input>
			<div class="ub-uploadImg" style="padding: 0;">
				<div class="ub-uploadImg-title">
					<p>上传照片</p>
					<p>{{imagesList.length}}/9</p>
				</div>
				<div class="ub-upImage">
					<div class="ub-upImage" v-for="(item, index) in imagesList">
						<img v-cloak @click="deleteNoteImage(index)"
							style="width: 20px;position: absolute;right: -8px;top: -8px;" src="images/deteleImg.png">
						<img @click="lookImg(imagesList)" style="width: 90px;height: 50px;" :src="item">
					</div>
					<i v-show="isUploadLoading" style="font-size: 20px;" class="el-icon-loading"></i>
					<div v-show="isUploadNoteImg" class="ub-uploadImg-btn">
						<img @click="uploadImageBtn(2)" src="images/addPlaceupImg.png">
						<!-- <p>拍摄或上传照片</p> -->
					</div>
				</div>
			</div>
			<span slot="footer" class="dialog-footer">
				<el-button type="primary" @click="noteOut()">完 成</el-button>
			</span>
		</el-dialog>
		<!-- 选择场所经纬度弹窗 -->
		<el-dialog v-cloak id="manual" center title="请选择场所位置" :visible.sync="isManual" width="95%">
			<div id="container"></div>
			<div @click="goCurrent()" class="ub-goLocation">
				<img src="images/center.png">
			</div>
			<div v-cloak class="ub-positioning">
				<img src="images/positioning.png" alt="">
			</div>
			<span slot="footer" class="dialog-footer"
				style="display: flex;justify-content: center;;position: absolute;left: 0;right: 0;bottom: 15px;">
				<el-button @click="isManual = false">取 消</el-button>
				<el-button type="primary" @click="confirmLocation()">确 定</el-button>
			</span>
		</el-dialog>
		<!-- 底部导航栏 -->
		<div class="ub-footerNav">
			<div role="tablist" style="background: #fff;" aria-label="选项卡标题" class="weui-tabbar">
				<a href="index.html" id="tab2" role="tab" aria-labelledby="t2_title" aria-selected="false"
					aria-controls="panel2" class="weui-tabbar__item">
					<img src="images/navIcon1.png" alt="" class="weui-tabbar__icon">
					<p aria-hidden="true" id="t2_title" class="weui-tabbar__label">地图查看</p>
				</a>
				<a href="listLook.html" id="tab3" role="tab" aria-labelledby="t3_title" aria-describedby="t3_tips"
					aria-selected="false" aria-controls="panel3" class="weui-tabbar__item">
					<div id="t3_tips" aria-hidden="true" style="display: inline-block; position: relative;">
						<img src="images/navIcon3.png" alt="" class="weui-tabbar__icon">
						<!-- <span class="weui-badge weui-badge_dot" role="img" alt="new"
							style="position: absolute; top: 0; right: -6px;"></span> -->
					</div>
					<p id="t3_title" aria-hidden="true" class="weui-tabbar__label">列表查看</p>
				</a>
				<a href="personalCenter.html" id="tab1" role="tab" aria-labelledby="t1_title" aria-describedby="t1_tips"
					aria-selected="true" aria-controls="panel1" class="weui-tabbar__item weui-bar__item_on">
					<div id="t1_tips" aria-hidden="true" style="display: inline-block; position: relative;">
						<img src="images/navIcon2-selected.png" alt="" class="weui-tabbar__icon">
						<!-- <span class="weui-badge" style="position: absolute; top: -2px; right: -13px;">8</span> -->
					</div>
					<p id="t1_title" aria-hidden="true" class="weui-tabbar__label">个人中心</p>
				</a>
			</div>
		</div>
	</div>
	<!-- 	<script>
			window._AMapSecurityConfig = {
				securityJsCode: "938130475c2bd4cb71d78257a3db284c" // 开发环境使用
			}
		</script> -->
	<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/element-ui.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jweixin-1.6.0.js" type="text/javascript" charset="utf-8"></script>
	<!-- <script src="js/http.js?v=17.0.0" type="text/javascript" charset="utf-8"></script> -->
	<script src="js/jwt-decode.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/cHttp.js?v=1.0.0" type="text/javascript" charset="utf-8"></script>
	<script src="js/wxPublic.js?v=17.0.0" type="text/javascript" charset="utf-8"></script>
	<script src="https://cdn.bootcdn.net/ajax/libs/fastclick/1.0.6/fastclick.min.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="js/t-gConversion.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/g-tConversion.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/tdApi.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/placeEditor.js?v=1.0.1" type="text/javascript" charset="utf-8"></script>
	<!-- <script src="http://api.tianditu.gov.cn/api?v=4.0&tk=56127c6ce12385b28ddd1f358d3b898e"
		type="text/javascript"></script> -->
	<!-- <script
			src="https://webapi.amap.com/maps?v=2.0&key=98151bd8211171db74270a09d7dde508&plugin=AMap.DistrictSearch">
		</script> -->
</body>

</html>